package com.zy.test.widget;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import com.zy.activity.BaseMainActivity;

public class ViewTestMainActivity extends BaseMainActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //设置横屏
        //setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    }

    @Override
    protected Fragment getContainerFragment() {
        int code = getIntent().getIntExtra("code", 0);
        Class targetClass = (Class) getIntent().getSerializableExtra("targetClass");


        Fragment fragment = null;
        if (targetClass != null) {
            try {
                fragment = (Fragment) targetClass.newInstance();
            } catch (IllegalAccessException | InstantiationException e) {
                e.printStackTrace();
            }
        }
        return fragment;
    }
}